<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KnowTypeList.aspx.cs" Inherits="Admin_Know_KnowTypeList" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加知道类别</title>
    <link rel="stylesheet" href="../skin/style.css" type="text/css" />

    <script type="text/javascript" src="../../js/jquery.js"></script>

    <script type="text/ecmascript">
     function IsNum(obj)
	   {
		 var vlu=obj.value.replace(/\D/g,'');
		 if(obj.value!=vlu)
		 {
		  alert("输入的必须都为整数");
		  obj.focus();
		  }
		 return false;
	   }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                操作提示</h3>
        </div>
        <div class="itemtitle_tect">
            <ul>
                <li>通过用户管理，您可以进行编辑会员资料、用户组、权限、积分、授权会员勋章以及删除会员等操作；</li>
                <li>请先根据条件搜索用户，然后选择相应的操作。 </li>
            </ul>
        </div>
        <div class="clr">
        </div>
        <asp:Panel ID="pnlKnowType" runat="server" Visible="False">
            <div class="itemtitle">
                <h3>
                    添加知道分类</h3>
            </div>
            <div class="itemtitle_tect">
                <p>
                    知道分类名称：
                    <asp:TextBox ID="txtType" runat="server"></asp:TextBox>
                    <asp:Button ID="btnInsert" runat="server" OnClick="btnInsert_Click" Text="添加" />
                    <asp:Button ID="btnReturn" runat="server" OnClick="btnReturn_Click" Text="取消" />
                </p>
            </div>
            <div class="clr">
            </div>
        </asp:Panel>
        <div class="partition">
            <div class="Option">
                <asp:Label ID="Label5" runat="server"><strong>快捷操作</strong></asp:Label>
                <span>
                    <asp:LinkButton ID="lbtnSave" runat="server" OnClick="lbtnSave_Click" Text="添加分类" /></span>
            </div>
        </div>
        <div class="clr">
            <asp:Label ID="Label1" runat="server"></asp:Label></div>
        <div class="talbe_border">
            <asp:GridView ID="grdKnowType" runat="server" AutoGenerateColumns="False" GridLines="None"
                DataKeyNames="ID" CssClass="talbe_list" OnRowDeleting="grdKnowType_RowDeleting" OnRowEditing="grdKnowType_RowEditing" OnRowUpdating="grdKnowType_RowUpdating" OnRowCancelingEdit="grdKnowType_RowCancelingEdit">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="th20 tou" />
                        <ItemStyle CssClass="nolet" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="知道类别">
                        <ItemTemplate>
                            <a href='KnowTypeList.aspx?ParentID=<%# DataBinder.Eval(Container.DataItem,"ID") %>'>
                                <%# DataBinder.Eval(Container.DataItem,"Name") %>
                            </a>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("Name") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemStyle CssClass="left2" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作选项" ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                Text="更新"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <HeaderStyle CssClass="th80" />
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="编辑"></asp:LinkButton>
                            |
                            <asp:LinkButton ID="lbtnDelete" Style="text-decoration: none" runat="server" Text="删除"
                                OnClientClick="return confirm('你确定要删除吗?')" CommandName="delete">
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="header" />
            </asp:GridView>
            <div class="Paging">
                <p>
                    <uc1:PageNo ID="PageNo1" runat="server" />
                </p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
                <asp:Button ID="btnDelete" runat="server" Font-Size="9pt" OnClick="btnDelete_Click"
                    Text="批量删除" CssClass="i_button" OnClientClick="return confirm('你确定要删除吗?')" />
                <asp:Label ID="lblMessage" runat="server" Visible="false"></asp:Label>
            </div>
        </div>
    </form>

    <script type="text/javascript" src="../../js/Common.js"></script>

    <script type="text/javascript"> 
    if ($("btnInsert")){
      $("btnInsert").onclick=function (){
          if($("txtType").value.replace(/\s/g,'')==""){
              alert("知道类别名称不能为空!")
              $("txtType").focus()
              return false
          }
           else{
              return true 
          }
       }
    }
    
    </script>

</body>
</html>

